home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #11 / Amiga Plus CD - 2004 - No. 11.iso / AmiSoft / Dev / basic / blitzgtfix.lha / BlitzGTFix / BBGTLib_Examples / gtlistview.bb2 < prev    next >
Text File  |  2002-01-27  |  1KB  |  60 lines

  1. WbToScreen 3
  2. Use Screen 3
  3.  
  4. LoadFont 2,"topaz.font",8
  5. Use IntuiFont 2
  6.  
  7.  
  8. ; DONT USE COMMANDS WHICH USE A3 AS A PARAMETER DIRECTLY WITH HEX$
  9. ; COS IT GOES SCREWY
  10.  
  11. NEWTYPE.gtlv_item
  12.     pad.w
  13.     text$
  14. End NEWTYPE
  15.  
  16. Dim List dummy.gtlv_item(10)
  17. While AddItem(dummy())
  18.     dummy()\text = String$(Chr$(Rnd(26)+65),5+Rnd(5))
  19. Wend
  20.  
  21.  
  22. foo.l=GTListView(0,1,20,20,80,50,"Normal",#PLACETEXT_ABOVE,dummy())
  23. NPrint Hex$(foo)
  24.  
  25. foo.l=GTListView(0,2,130,20,80,50,"Disabled (OS3+)",#PLACETEXT_ABOVE|$40,dummy())
  26. NPrint Hex$(foo)
  27.  
  28. foo.l=GTListView(0,3,240,20,80,50,"Read only",#PLACETEXT_ABOVE|$1000,dummy())
  29. NPrint Hex$(foo)
  30.  
  31. GTTags #GTLV_ShowSelected,0
  32. foo.l=GTListView(0,4,350,20,80,50,"Selected",#PLACETEXT_ABOVE,dummy(),2)
  33. NPrint Hex$(foo)
  34.  
  35. GTTags #GTLV_ShowSelected,0
  36. foo.l=GTListView(0,5,460,20,80,50,"Selected+Top",#PLACETEXT_ABOVE,dummy(),4,1)
  37. NPrint Hex$(foo)
  38.  
  39. GTNewLookProp On
  40. foo.l=GTListView(0,6,20,100,80,50,"NewLookProp",#PLACETEXT_ABOVE,dummy())
  41. NPrint Hex$(foo)
  42.  
  43.  
  44. AddIDCMP #LISTVIEWIDCMP
  45.  
  46. Window 0,0,0,600,300,$100f,"jjlk",-1,-1
  47. DefaultOutput
  48.  
  49. AttachGTList 0,0
  50. While ev.l<>#IDCMP_CLOSEWINDOW
  51.     ev.l=WaitEvent
  52.     Select ev
  53.         Case #IDCMP_GADGETUP
  54.             NPrint "Listview ",GadgetHit," hit, item number ",EventCode
  55.     End Select
  56. Wend
  57. DetachGTList 0
  58. End
  59.  
  60.